package com.itheima.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 通知实体
 *
 * @author 51585
 * @TableName notice
 */
@TableName(value = "notice")
@Data
public class Notice implements Serializable {
    private static final long serialVersionUID = -8598439226782677333L;
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题")
    @TableField(value = "title")
    private String title;

    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    @TableField(value = "content")
    private String content;

    /**
     * 通知状态【发布】【修改】【取消】
     */
    @ApiModelProperty(value = "通知状态")
    @TableField(value = "status")
    private String status;

    /**
     * 通知内容开始时间
     */
    @ApiModelProperty(value = "通知内容开始时间")
    @TableField(value = "start_time")
    private LocalDateTime startTime;

    /**
     * 通知内容结束时间
     */
    @ApiModelProperty(value = "通知内容结束时间")
    @TableField(value = "end_time")
    private LocalDateTime endTime;

    /**
     * 发送用户id
     */
    @ApiModelProperty(value = "发送用户id")
    @TableField(value = "user_id")
    private String userId;

    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_at", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    @ApiModelProperty(value = "删除时间")
    @TableField(value = "deleted_at")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableLogic
    private LocalDateTime deletedAt;

    /**
     * 发送形式
     */
    @ApiModelProperty(value = "发送形式")
    private String operation;
}